import { REQUEST_STATUS } from '../lib/enum/STATUS_CODE'
import { ApiResponse } from '../lib/class/Response'
import { LatencySimulator } from './LatencySimulator'

export let AvatarInfo = function (user) {
  if (!user) {
    return new ApiResponse(
      [{ index: 0, url: '/avatar.png' }],
      REQUEST_STATUS.REQUEST_ERROR
    )
  } else {
    LatencySimulator.AsyncSleep(3000)
    return new ApiResponse(
      [{ index: 0, url: '/avatar.png' }],
      REQUEST_STATUS.REQUEST_SUCCESS
    )
  }
}
